import Taro from '@tarojs/taro-rn';
import * as tslib_1 from "tslib";
import React from 'react';
import { Component } from "@tarojs/taro-rn";
import { View, RichText } from "@tarojs/components-rn";
import { toJS } from 'mobx';
import { inject, observer } from "@tarojs/mobx-rn";
import { getRuntime } from "../../utils/common";
import help_detailStyleSheet from "./help_detail_styles";
var _styleSheet = help_detailStyleSheet;
let HelpDetail = class HelpDetail extends Component {
  constructor(props) {
    super(props);
    this.state = {
      info: {}
    };
  }
  componentWillMount() {
    Taro.setNavigationBarTitle({ title: '问题详情' });
    let id = this.$router.params.id;
    this.getDoubtAnswer(parseInt(id));
  }
  handelRouter(url = '/pages/index/index') {
    getRuntime().navigateTo(url);
  }
  getDoubtAnswer(id) {
    let { userStore } = this.props.stores;
    userStore.getDoubtAnswer({
      formId: id,
      callback: res => {
        this.setState({ info: toJS(res) });
      }
    });
  }
  render() {
    let { info } = this.state;
    return <View style={_styleSheet["my-help-detail"]}>
        <View style={_styleSheet["list-title"]}>{info['title']}</View>
        <View style={[_styleSheet["article-wrap"], _styleSheet["article"], _styleSheet["rich-text"]]}>
          <RichText nodes={info['content']} />
          {info}
        </View>
      </View>;
  }
};
HelpDetail = tslib_1.__decorate([inject("stores"), observer], HelpDetail);
export default HelpDetail;